Repository navigation
feat(config): accept an object for launch args - #1903
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 27 files
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 15 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Re-trigger cubic
okwasniewski
left a comment
There was a problem hiding this comment.
[claude-opus-5-5] automated review on behalf of @okwasniewski
Checked 84a7c01 (plus a local merge with current main): read the diff, ran the new and touched unit tests, typecheck, oxlint, the docs translation check, mutation-checked the new tests, and probed the encoder directly. Thanks for the careful PR, the core validation and tests are solid. One maintainer call on the Android side (below), plus a couple of fixes.
Must fix
docs/mobile.mdx:85says{ e2e: true }is--es e2e trueon Android. The code (and the reference table) sends--ez e2e true. Should read--ez.docs/ja/*anddocs/zh/*are not mirrored. After merging main,node scripts/check-docs-translations.tsfails onmobile.mdxcode block #7,reference/config.mdx#27 (a new block),reference/engine.mdx#34,reference/mobile.mdx#51, in both languages (main passes). Copy the changed code blocks into the ja and zh pages (the table rows and prose can stay in their language or follow later). This branch is based on a main from before the translations landed, so rebase first.
Should fix
packages/mobile/src/surface.ts:871-device.openAppvalidatespermissionsat runtime but notlaunchArguments. With the object form, a JS caller passing{ x: null }(or a nested object) getsTypeError: Cannot read properties of null (reading 'map')fromiosArgumentinstead of anINVALID_ARGUMENT. The Android Apple-name check fromvalidateAppis also skipped there, soopenApp(id, { launchArguments: { AppleLocale: 'fr_FR' } })on Android silently sends--es AppleLocale fr_FR. Suggest moving the shape check out ofconfig/app.tsinto one helper exported from@e2e-dev/core/engine(same as howassertPermissionsserves both paths), and call it plusassertLaunchArgumentsForfromopenAppwithINVALID_ARGUMENT.packages/mobile/src/launch-arguments.ts:84- the Android number flag depends on the value, not on what the app reads. JS has no int/float distinction, so{ ratio: 1.0 }sends--ei ratio 1and an app callinggetFloatExtra("ratio", 0f)gets0.{ id: 3_000_000_000 }flips to--el, sogetIntExtramisses it, and1e19sends--el 10000000000000000000, whichamfails to parse (cubic's open finding, it is real). Pending the decision below, the least surprising shape is: integers in Java int range as--ei, anything elseINVALID_CONFIGpointing at the list form (['--ef', 'ratio', '1.0'],['--el', ...]).
Nits
IOS_ONLY_ARGUMENTSis a hand list (misses e.g.AppleKeyboards,AppleMeasurementUnits,AppleTemperatureUnit,AppleFirstWeekday) and only guards the object form. Fine as a helpful error, just know it will drift.docs/migrate/detox.mdx:46"with the same keys": true on iOS; a Detox Android app reads launch args from instrumentation arguments, so the app code changes toIntentextras either way. Worth half a sentence.apps/mobile-benchmark/tests-launch-argumentsis hand-run only and the Android half asserts just(has extras). The unit tests already pin the spelling; consider dropping the extra config + script rather than carrying a check CI never runs.
Verified
@e2e-dev/mobilelaunch-arguments.test.ts+engine.test.ts: 249 passed.e2econfig.test.ts: 100 passed. Typecheck clean fore2e(incl.tests/types/sdk-types.ts),@e2e-dev/core,@e2e-dev/mobile,@e2e-dev/mobile-benchmark.pnpm lintclean.- Mutants, each caught:
--ez->--es(2 fail), iOSYES/NO->true/false(3 fail), drop--esacomma escaping (1 fail), drop thevalidateAppAndroid check (1 fail), pass the object tolaunchArgsunspelled (2 fail), dropNumber.isFinite(1 fail), drop theundefinedskip (1 fail). - Direct probe:
launchArgumentList('android', { ratio: 1.0, big: 1e19 })->['--ei', 'ratio', '1', '--el', 'big', '10000000000000000000']. - agent-device 0.21.38 quotes each
am startargv element, so string values with spaces and--esaescaped commas reachamintact. - Earlier cubic findings are addressed at this head except the
--elrange one (real, folded into the should-fix above). - CI: only the light checks ran (check, label, drop, cubic: all green); the full test workflows have not run on this fork PR yet.
The Android object-form mapping (typed extras vs ints only vs iOS-only vs all strings) waits on the maintainer; the must-fixes and the openApp validation can land now.
There was a problem hiding this comment.
All reported issues were addressed across 19 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
View guided diff | Re-trigger cubic
8d1739e to
a2e4e59
Compare
There was a problem hiding this comment.
All reported issues were addressed across 8 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 13 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval blocked by 8 unresolved issues from previous reviews.
View guided diff | Re-trigger cubic
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.
View guided diff | Re-trigger cubic
[claude-fable-5-1] automated reply on behalf of @luke-h1 (drafted with Claude, reviewed by @luke-h1) Thanks for the pass. Rebased on main Done: the --es/--ez line, the Apple names you listed (the comment now says the list isn't exhaustive, so an unlisted name passes), the Detox sentence, and the benchmark check is gone. openApp: validates launchArguments the way you suggested. The shape check moved to core as Numbers: 1e19 can't reach --el any more, core refuses anything beyond 2^53 - 1 at config load and on openApp. One thing that contradicts your run: the --esa comma escaping never worked. Intent.parseCommandArgs splits with ja/zh: copied the changed code blocks, the checkLaunchArguments heading, and the summary table's type cell into both, prose untouched |
okwasniewski
left a comment
There was a problem hiding this comment.
[claude-opus-5-5] automated review on behalf of @okwasniewski
Re-checked 9e6c141 (and a local merge with main 66d07ca, clean). Every ask from the last review is done: --ez in docs/mobile.mdx, ja/zh code blocks mirrored (translation check passes), device.openApp now runs checkLaunchArguments plus the Android rules with INVALID_ARGUMENT before any device command, 1e19 can't reach --el any more (2^53 bound), Apple list widened, Detox sentence added, hand-run benchmark check dropped. You're right about --esa: Intent.parseCommandArgs never strips the backslash, so refusing comma/backslash/empty items is the right fix. Thanks.
Must fix
packages/mobile/src/launch-arguments.ts:91and:98- on iOS, a value that starts with-gets dropped.NSUserDefaultsreads-offset -1as two keys, so{ offset: -1 }or{ mode: '-x' }reaches the app as nil, and nothing reports it. I checked this with a Foundation binary on the macOS host (same CFPreferences argument parser):./p -n -1givesn = nil,./p -n '"-1"'givesn = "-1", and-l '(-1, b)'works because list items are fine. Fix: send numbers throughplistStringtoo, and quote any string that starts with-(for example, drop-from the leading characterPLIST_UNQUOTEDallows). Add-1and'-x'iOS cases tolaunch-arguments.test.ts.
Should fix
packages/core/src/types.ts:1259-LaunchArgumentsallowsundefinedvalues, andEngineAppInfo.launchArgumentsand the resolved app use that same type, even thoughcheckLaunchArgumentsalready strips them. So every engine still has to handlevalue === undefined(launchArgumentListandassertLaunchArgumentsForboth do). HavecheckLaunchArgumentsreturn a narrower resolved type (readonly string[] | Readonly<Record<string, LaunchArgumentValue>>) and use it forEngineAppInfo,ResolvedApp, and the valuelaunchArgumentsForOpenreturns. Keep the wide type only on input (TargetApp,OpenAppOptions). Then the engine-sideundefinedbranches go away.
Nits
packages/core/src/internal/launch-arguments.ts:60- the array branch ofisLaunchArgumentValuenever runs, becausecheckLaunchArgumentshandles arrays before it gets there. Narrow the function to scalars.fail(code, message)appears twice, in core and mobile. Fine for now, but if a third copy shows up, export it from core.docs/migrate/detox.mdx:46- Detox on Android puts launch args into the activity intent as string values inside alaunchArgsbundle extra (getIntent().getBundleExtra("launchArgs"), seeActivityLaunchHelper.ktin detox 20.51.4), not only as instrumentation arguments. Something like "Detox nests them as strings in alaunchArgsbundle" would be more exact.- The changeset covers internals (plist quoting rules, the
checkLaunchArgumentsexport). It could stop at the object form, the per-platform spelling, and the Android refusals.
Verified
- On the merge with main:
@e2e-dev/mobilelaunch-arguments.test.ts+engine.test.ts253 passed,e2econfig.test.ts100 passed. Typecheck clean for core, e2e (incl.tests/types/sdk-types.ts), mobile (incl.tests/types/options.ts), web.oxlintclean.check-docs-translations(162 pages),check-changeset-bumps,check-peer-rangesall pass. - Mutants, each caught by at least one test: openApp skips validation, Android allows an empty item / empty list / trailing backslash, iOS skips quoting or quote escaping, fraction as
--ei, 2^53 bound removed,undefinedskip removed, empty name allowed, whitespace in name allowed, NUL check on object values removed. NSUserDefaultsprobe: bareYESstays the string"YES"(boolForKeytrue),"(draft)"quoted is a string, unquoted(draft)is an array,''is an empty string. So cubic's plist-literal finding is not real, and the quoting rules are correct except for the leading-.- Open cubic threads:
--elrange is fixed. Peer range: not real, since npm has only0.0.0and0.23.2-nightlyprereleases of@e2e-dev/core, and none of them satisfies>=0.23.2. Benchmark Android assertion: moot, the file is gone. ja/zh untranslated prose: fine, as agreed. - CI: light checks green.
docs translations,spec,mobile,docs,benchmarkare waiting on approval (action_required) as a fork PR and have not run yet.
9e6c141 to
856914c
Compare
[claude-opus-5-5] automated reply on behalf of @luke-h1 (drafted with Claude, reviewed by @luke-h1) Thanks - I've rebased with main and pushed a fix per commit:
Left Ran it on a simulator (iOS 26.1) and an Android emulator with a small probe test script that reads each value with the typed getter (
Two things I'd like your feedback on 🤔:
|
Superseded by the latest automated re-check.
okwasniewski
left a comment
There was a problem hiding this comment.
[claude-opus-5-5] automated review on behalf of @okwasniewski
Re-checked 856914c (and a local merge with main 8eb3cc2, clean). Every ask from the last review is done: numbers and --leading strings go through plistString on iOS, with -1, -0.5, '-x' and a -x list item tested; checkLaunchArguments returns ResolvedLaunchArguments and the engine-side undefined branches are gone; isLaunchArgumentScalar replaces the dead array branch; the Detox row names the launchArgs bundle; the changeset is trimmed. Thanks, and thanks for the device run.
Must fix
packages/mobile/package.json:75and:77- the peers still say@e2e-dev/core >=0.23.2ande2e >=0.23.2, butlaunch-arguments.tsimportscheckLaunchArgumentsfrom@e2e-dev/core/engine, and the published@e2e-dev/core@0.24.0has no such export (checked the npm tarball). A user who updates@e2e-dev/mobilealone and keepse2e@0.24.0(which pins core0.24.0) gets a module-loadSyntaxErrorthe moment their config importsmobile(). This answers your second question: the floor belongs in this PR. Raise both to>=0.24.1 <1.
Should fix
.changeset/launch-arguments-object.md:5-'@e2e-dev/web': patchreleases a package this PR does not change (no file underpackages/web).check-changeset-bumpspasses without that line, so remove it.
On your first question (EngineAppInfo.launchArguments widening)
Having core turn the object into a string[] would move the platform spelling (-name value vs --ez/--esa extras) into core, which has no idea which platform it is writing for. That logic belongs to the engine, and the PR already puts it there. Whether the widened type counts as breaking is a maintainer call. At runtime an engine only gets an object when its user writes the new form, so existing configs behave as before. Leave the PR as is until @okwasniewski decides.
Nits
packages/core/src/engine/index.tsis at 999 lines after this PR (998 on main). Not your problem, but the next export added there will cross the 1000-line limit.
Verified
- On the merge with main:
@e2e-dev/mobilelaunch-arguments.test.ts+engine.test.ts: 260 passed.e2econfig.test.ts: 104 passed. Typecheck clean for core, e2e, mobile, and web.oxlint,check-docs-translations,check-peer-ranges,check-changeset-bumps, andcheck-error-codesall clean. - Mutants, each caught by one test: leading
-allowed unquoted inPLIST_UNQUOTED, iOS numbers sent raw instead of throughplistString. launch()app overrides go through the samecheckTargetApppath, so the object form is checked there too.- cubic did not review this head (its incremental review failed to start). Earlier cubic threads stay as resolved last round.
- CI: only the light checks ran (check, label, drop, review-label, pr-size, pr-policy: green; cubic: neutral).
mobile,docs translations,spec, anddocsareaction_required: this is a fork PR and they wait on maintainer approval.
Two maintainer calls are still open: the Android number mapping ({ ratio: 1.0 } still sends --ei) and whether the EngineAppInfo widening is breaking.
856914c to
8d2a3ab
Compare
There was a problem hiding this comment.
0 issues found across 3 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
21800ed to
deabd19
Compare
Thanks for the pass - fingers crossed this should be the last round of fixes 🫡
|
okwasniewski
left a comment
There was a problem hiding this comment.
[claude-opus-5-5] automated review on behalf of @okwasniewski
Re-checked deabd19 (based on main c30354f, no conflicts). Both asks from the last review are done: the e2e peer floor in @e2e-dev/mobile is raised next to core's, and the @e2e-dev/web changeset line is gone. The new desktop commits look right: desktop() spells an object the same way iOS does, and both launch paths (agent-desktop launch and open --args) are covered. Thanks.
Must fix
None.
Should fix
packages/mobile/package.json:75and:77->=0.24.1 <1is safe, but 0.24.1 will never ship: the pending release (#1974) goes from 0.24.0 straight to 0.25.0 for@e2e-dev/coreande2e. Please change both to>=0.25.0 <1so the floor names a release that exists.packages/desktop/src/launch-arguments.ts:4-30copiesPLIST_UNQUOTED,plistString, and the-name valuespelling frompackages/mobile/src/launch-arguments.ts(iosArgument) word for word. These rules are subtle: the leading-quoting took a whole round to get right. With two copies, the next fix will land in one and miss the other. One home for theNSUserDefaultsspelling would fix that, for example anappleUserDefaults(launchArguments)export from@e2e-dev/core/enginethat both engines call. That would make desktop's core floor>=0.25.0too. If @okwasniewski would rather keep core free of Apple spelling, keep the copies but have each one point to the other in a comment.
Verified
@e2e-dev/desktoplaunch-arguments.test.ts+surface.test.ts: 113 passed (theappPathtest runs on darwin).@e2e-dev/mobilelaunch-arguments.test.ts+engine.test.ts: 292 passed.e2econfig.test.ts: 104 passed.- Typecheck clean for core, e2e, mobile, desktop, and web.
oxlint,check-changeset-bumps,check-peer-ranges,check-docs-translations,check-error-codes, andcheck-docs-examplesall clean. - Mutants on desktop, each caught: a leading
-allowed unquoted (the unit test fails), and booleans sent astrue/falseinstead ofYES/NO(the unit test and both surface tests fail). - Desktop imports only types from
@e2e-dev/core/engine, so its>=0.23.2peers still hold as written. - cubic reviewed only the last push (0 issues) and has no open threads.
- CI on deabd19 after approval: build, check, web, docs, docs translations, bun, install, benchmark, and the gates are green.
test(Node 22/24/26),mobile,spec, andandroid/ios deterministicwere still running at the time of this review.
Two maintainer calls are still open: the Android number mapping ({ ratio: 1.0 } still sends --ei), and whether widening EngineAppInfo breaks anything. On the second: a new e2e with an object form, paired with an older @e2e-dev/mobile (or a third-party engine) that spreads app.launchArguments, fails with a TypeError (not iterable) and no config error.
Superseded by the latest automated re-check.
NSUserDefaults reads `-offset -1` as two keys, so `{ offset: -1 }` or `{ mode: '-x' }` reached the app as nil. Numbers now go through plistString too, and a value starting with `-` is quoted.
checkLaunchArguments already drops undefined entries, so it now returns ResolvedLaunchArguments, used by EngineAppInfo, ResolvedApp and openApp. The undefined branches in the mobile spelling go away.
Also scopes the config reference's table link to iOS and Android.
Mobile and desktop each carried a copy of the plist quoting rules. Both now call appleUserDefaults from @e2e-dev/core/engine, so a fix lands in one place.
A list item starting with // opened an old-style plist comment, so the whole list read back as nil. A name like -AppleLocale went out as --AppleLocale and never reached the app's locale. Adds tests for the Android int32 bounds and empty-string quoting, and notes in the migration docs that an app reading raw process arguments should keep the list form.
The message now says what to do and why: the engine adds the dash.
The iOS bullet in the mobile reference gets a list-form config for an app that reads ProcessInfo.processInfo.arguments, and the Detox config passes the same launch argument on both platforms. Every launch-argument code block is mirrored into the translations: the Detox config and the new block in ja and zh, appleUserDefaults in the ja and zh engine reference, and the object form of the language example in cs, es, pt, hi, and fr.
78df7df to
6b43448
Compare
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at 6b434480b, with 0007636f0 as the merge base.
Thanks for the follow-up, Luke. The Apple list now reads back correctly, and the dashed-key diagnostic, integer boundaries, empty string coverage, and raw-argument migration guidance are in place. The engine compatibility decision is the remaining merge blocker.
Must fix
- Keep
EngineAppInfo.launchArgumentsiterable for existing engines. From the built core I launched a custom engine that spreadsapp.launchArguments. The list form completed. Passing{ AppleLocale: 'fr_FR', AppleLanguages: ['fr'] }sent an object to the existing lifecycle receiver, which failed with “not iterable.” The unchanged spread also fails to compile against the new declaration. Published mobile 0.12.8 uses that same spread, and its peer ranges admit a newer runner and core. I'd keep the existing list field and deliver the map through an opt-in field or conversion hook. An engine without support should reject the map at config load. Add a test using an existing array-consuming engine and a round-trip test for the new engine path. If we deliberately break the contract, that needs the maintainer's decision under the stability policy. Public field · Stability policy
Optional
-
The engine reference should mention that argument names cannot start with a dash and that a string starting with
//is quoted, including inside a list. The implementation and tests already do this. Engine reference -
Please bring the PR description up to this head. Mention the desktop support, shared encoder, and dashed-name rejection, and label the verification evidence with the revision each run used.
For the maintainer
- If the engine contract changes, the current release rule requires a changeset for every engine. The PR omits web because the earlier review asked Luke to remove it. Please confirm the exception or restore the web entry. Also, #1974 still plans core 0.25.0 without the new helpers. If it ships first, mobile and desktop need the first core version that actually exports the helpers. Release rule · Version packages PR
- Android extras are still a scope decision. A JavaScript
1.0is sent as an integer, so it will not satisfygetFloatExtra. Keeping the feature is reasonable if the docs tell Android callers to use raw--efwhen the app expects a float even at whole-number values. The original issue requested the map and preserving the list form. Android encoder · Original issue
Verified
- The built merge base accepts the list form and rejects the map at configuration load. The candidate sends the map over the existing engine protocol. The unchanged array spread fails in TypeScript and at runtime on that map. Published core 0.24.0 and the built merge base compile the same spread.
- macOS Foundation read no list on the previous revision and read the exact two strings on the candidate. The iOS 27.2 simulator read the list through configured launch and
device.openApp. The Android 15 emulator read the expected extra types. Both platforms passed an equivalent raw-list control and rejected the dashed key. pnpm check, the testbed, and the deterministic web benchmark passed.pnpm teststopped at one desktop timing assertion. The focused version of that test passed on the candidate and merge base, and all later package commands passed when run separately.- The offline web agent suite had eight failures on each revision. Seven listed test titles matched, one changed between revisions, and the logs reported model provider failures. The full mobile benchmark recorded 117 passed, six failed and two skipped, with the failures on iOS. Neither result is a clean release gate. I did not run the full mobile benchmark against the merge base, so those failures are unclassified.
- All six targeted mutations for Apple quoting, dashed names and Android integer limits were caught by tests. The base-control tool could not load two new test files because their implementation modules do not exist on the base. The other seven new tests it could evaluate failed there.
- GitHub's benchmark, mobile, spec and docs workflows still require maintainer authorization.
These are my review findings. The approval is @okwasniewski's.
…rough launchArgumentValues An engine that spreads app.launchArguments broke when a target passed an object, and the spread stopped compiling against the widened type. launchArguments is a string list again. The object form goes to a new EngineAppInfo.launchArgumentValues, only for engines that declare launchArgumentValues: true (carried through defineEngine and the manifest). Any other engine gets INVALID_CONFIG at config load, so published mobile 0.12.8 on a newer core refuses the object instead of crashing. mobile() and desktop() opt in.
There was a problem hiding this comment.
All reported issues were addressed across 29 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
…nApp refuses a dashed name at the call
There was a problem hiding this comment.
0 issues found across 2 files (changes from recent commits).
Heads up: you’ve reached your flex budget. Increase your flex budget or wait for usage to reset.
Requires human review: Auto-approval skipped because cubic reviewed only this push, not the earlier force-push. Comment @cubic review to review the whole pull request.
View guided diff | Re-trigger cubic
thanks, good catch. I've fixed this in 7f4a2f2 and 5a7b87a.
One small nitpick I found during testing. It's existing behaviour, so it could be a follow-up for a cleaner experience. If a web user provides { name: 'chromium', engine: web(), app: { url: 'http://localhost:3000', launchArguments: { AppleLocale: 'fr_FR' } } }
So a user or agent has to go through two steps to fix it:
So this PR behaves much like main, but it still sends users and agents on a detour. If you'd like, @michal-e2e, we could fix it with one change in two parts (appreciate there's been a lot of back and forth on this PR, so happy to do it in another PR if that's easier):
|
okwasniewski
left a comment
There was a problem hiding this comment.
[claude-opus-5-5] automated review on behalf of @okwasniewski
Re-checked 5a7b87a (merge base 0007636, merges cleanly with main 51cbd2e). @michal-e2e's must-fix is done. EngineAppInfo.launchArguments is a readonly string[] again. The object form now goes to a new EngineAppInfo.launchArgumentValues, and only engines that set launchArgumentValues: true get it. The flag goes through defineEngine, the manifest, its schema, and the protocol client. Any other engine gets INVALID_CONFIG at config load. mobile() and desktop() opt in, and both read launchArgumentValues ?? launchArguments everywhere they launch. Our earlier asks are still in place. The mobile and desktop floors on core/e2e are >=0.25.0 <1, and #1974 is still open, so 0.25.0 will ship this. Thanks for the quick turnaround.
Must fix
None.
Should fix
None.
Nits
packages/core/src/internal/launch-arguments.ts:61:launchArguments as LaunchArgumentValuesis there only becauseArray.isArraydoes not narrow areadonly string[]union. A smallisLaunchArgumentListtype guard would remove the cast.docs/reference/mobile.mdx:386/docs/reference/config.mdx:520: a whole-number value such as1or1.0goes out as--ei, sogetFloatExtranever reads it. One sentence telling Android callers to use the raw list (['--ef', 'scale', '1.0']) when the app reads a float would save someone a debugging session.- The web detour you described (an object on a
web()target first gets "takes only a list", then "opens app.url") is fine as a follow-up. Moving the opt-in check aftervalidateAppwould fix it.
Verified
- Built core and
e2eat 5a7b87a, then rane2e runon a scratch project with a custom engine that spreadsapp.launchArgumentsinvalidateApp,prepare, andinit. With['-AppleLocale', 'fr_FR']the test passed, and all four hooks spread the list. With{ AppleLocale: 'fr_FR', AppleLanguages: ['fr'] }the run stopped at config load withtarget "t" app.launchArguments is an object, and engine "legacy" takes only a list of strings: ..., before any engine hook ran. The same engine withlaunchArgumentValues: truereceived{ AppleLocale, AppleLanguages, on: true, n: 3 }(theundefinedentry dropped) inlaunchArgumentValuesonly, andlaunchArgumentswas absent. - Published
@e2e-dev/mobile0.12.8 (npm pack) does not set the flag and spreadsthis.app.launchArguments, so on this core it gets the config-load refusal instead of crashing. - Tests:
e2econfig.test.ts+engine-protocol.test.ts172 passed.@e2e-dev/mobilelaunch-arguments.test.ts+engine.test.ts319 passed.@e2e-dev/desktoplaunch-arguments,surface, andenginetests 180 passed, 1 skipped. - Typecheck is clean for core,
e2e(includingsdk-types.ts), mobile, desktop, and web.oxlint,check-peer-ranges,check-changeset-bumps,check-error-codes,check-examples, andplugins:checkare clean too. - Mutants, each caught: removing the opt-in check in
config/app.ts(1 fail), dropping the flag in the protocol client (2) or indescribeEngine(2), putting the object inlaunchArguments(1), and removinglaunchArgumentValues: truefrom mobile (1) or desktop (1). - No source file this PR touches goes past 1000 lines for the first time.
types.ts, bothsurface.tsfiles, and the large test files were already over the limit on main and grow by 1 to 76 lines. - cubic: 0 open findings on the last two pushes.
- CI on 5a7b87a:
check,pr-policy, and labels are green.spec,mobile,benchmark,docs, anddocs translationsareaction_required(fork runs waiting for maintainer approval), so test/mobile/docs CI has not run on this head yet.
kdy1
left a comment
There was a problem hiding this comment.
Note
This text was drafted with AI and posted after human approval.
- Harness: T3 Code
- AI agents: coordinator: Claude Opus 5.5 (claude-opus-5-5), reviewer: GPT-6.2 Astra (gpt-6.2-astra), reviewer: GPT-6.2 Sol (gpt-6.2-sol), reviewer: Claude Opus 5.5 (claude-opus-5-5), reviewer: Claude Sonnet 5.5 (claude-sonnet-5-5)
Verdict: Approve
This review approves the pull request. The P3 items are optional and do not block the merge.
This pull request lets app.launchArguments and device.openApp({ launchArguments }) take an object of argument name to value. mobile() spells the object as -name value user defaults on iOS and as typed am start extras on Android, and desktop() uses the Apple form. The engine contract stays backward compatible: EngineAppInfo.launchArguments is still a list, and only an engine that declares launchArgumentValues: true gets the object. I reviewed the head at 5a7b87a. I built core, e2e, mobile, desktop, and web. The targeted unit tests passed (mobile 319, desktop 180 with 1 skipped, e2e config, protocol, and schema 211), and the package typechecks passed. The same inputs ran on the base and on the head. The iOS locale object fails with INVALID_CONFIG on the base and works on the head. An existing list gives the same arguments on both sides. The generated iOS arguments were also read back through macOS Foundation UserDefaults, and every value arrived as written. The branch merges cleanly with the current main. I found three small, non-blocking problems, listed below.
Reviewed commit: 5a7b87a1877a015a334aa3a00835931c1a47c3a1
- P3 (non-blocking): 3 (3 inline)
| if (launchArguments !== undefined && (!Array.isArray(launchArguments) || !launchArguments.every((argument) => typeof argument === 'string'))) { | ||
| throw new ConfigurationError('INVALID_CONFIG', `${where}.launchArguments must be an array of strings`); | ||
| const launchArguments = checkLaunchArguments(`${where}.launchArguments`, app.launchArguments); | ||
| if (launchArguments !== undefined && !Array.isArray(launchArguments) && engine !== undefined && engine.launchArgumentValues !== true) { |
There was a problem hiding this comment.
P3 · Non-blocking · The object-form error gives wrong advice for an engine that takes no launch arguments
Optional. This does not block the merge.
The check for launchArgumentValues runs before the engine's own validateApp, and it runs for every engine that does not declare the flag.
Trigger: a web() target with app: { url: 'http://localhost:3000', launchArguments: { A: 1 } }.
Result on the built head:
INVALID_CONFIG target "t" app.launchArguments is an object, and engine "web" takes only a list of strings: write the arguments as a list, or use an engine version that supports the object syntax
Both parts of that advice are wrong for web(). If the user writes a list, the next run fails with declares app.launchArguments, which describes an installed device app; a web() target opens app.url (packages/web/src/engine.ts, NATIVE_APP_KEYS). Also, no version of web() takes the object form.
An object whose values are all undefined, for example { A: process.env.UNSET }, gets the same message. The LaunchArguments docs say that such an entry is left out, so nothing would be sent.
On the base, both inputs also fail, but with must be an array of strings. This is a problem with the message only. No launch behavior changes.
| return Object.fromEntries(entries); | ||
| } | ||
|
|
||
| export function engineLaunchArguments(launchArguments: ResolvedLaunchArguments | undefined): { |
There was a problem hiding this comment.
P3 · Non-blocking · Four new exported functions have no JSDoc
Optional. This does not block the merge.
AGENTS.md asks for "JSDoc on new functions". These new exports have no doc comment, but the other new functions in the same files have one:
engineLaunchArguments(packages/core/src/internal/launch-arguments.ts:56)launchArgumentsForOpen(packages/mobile/src/launch-arguments.ts:23)launchArgumentList(packages/mobile/src/launch-arguments.ts:59)launchArgumentList(packages/desktop/src/launch-arguments.ts:3)
| "description": "prepare binds the device e2e run --device names.", | ||
| "type": "boolean" | ||
| }, | ||
| "launchArgumentValues": { |
There was a problem hiding this comment.
P3 · Non-blocking · The invalid manifest fixture does not cover the new launchArgumentValues field
Optional. This does not block the merge.
AGENTS.md says that a wire change edits the schema, both fixtures, and the producer in one review. This change adds launchArgumentValues to the schema and to engine-manifest-v1.valid.json, but engine-manifest-v1.invalid.json still exercises only a duplicate action. If the schema stopped checking the type of this field, the fixture tests would still pass. The schema rejects "yes" today, so this is a coverage gap, not a wrong result.
Note: #2002 added selectsDevice in the same way (schema and valid fixture only), so this follows existing practice. A maintainer can decide whether the rule applies to plain boolean fields.
…inc#2229) - github, integrations/index, and the ci/ pages: github-actions, gitlab, vercel-previews, eas-workflows, bitrise, codemagic, norrix - catch up English changes the pt pages were missing: authentication (e2e-inc#2131), mobile (e2e-inc#1903, e2e-inc#2192), ci (e2e-inc#2137), web (e2e-inc#2147), cache (e2e-inc#2093), models (e2e-inc#2146) - ci: "step" for a CI step, as on the new pages - README: glossary rows for the CI terms
What and why
Part of #1855, the
app: { launchArguments: { AppleLocale: 'fr_FR' } }row.app.launchArgumentsnow supports{ name: value }as well as the list of strings. Detox and Maestro suites have a map to port, andAppleLanguages: ['fr']is easier to write than'-AppleLanguages', '(fr)'.packages/core/src/config/app.ts.mobile()writes each entry for its platform inpackages/mobile/src/launch-arguments.ts:-name valueon iOS, and on Android anam startextra of the value's type (--ez,--ei,--ef,--es,--esa), so the app reads it with the matchingIntentgetter. An object with one of Apple's keys on an Android target fails at config load.device.openApp(app, { launchArguments })takes the same object form and checks it the way config load does, withINVALID_ARGUMENT. The shape check ischeckLaunchArguments, exported from@e2e-dev/core/engine.am start --esasplits on each comma, keeps the backslash before an escaped one, and reads an empty value as one empty item. An object's list on Android is refused when it is empty or an item is empty, holds a comma, or ends in a backslash. An iOS string value goes out as a plist string, so'(draft)'reaches the app as text, not an array. Core refuses a number beyond 2^53 and a NUL character.device.openAppis now shape-checked.EngineAppInfo.launchArgumentsis stillreadonly string[], so an engine that spreads it keeps working, including published@e2e-dev/mobile0.12.8, whose peer ranges admit this core. The object goes to a new field,EngineAppInfo.launchArgumentValues, only for an engine that declareslaunchArgumentValues: true(defineEngine, the engine manifest, and its schema). Any other engine getsINVALID_CONFIGat config load and never sees the object.mobile()anddesktop()opt in.IOS changes:
Android changes:
^ this change wasn't asked for in this proposed API but I thought it'd be a good quality of life improvement for the Android side. Let me know if it should be taken out 👍
Issue
feature: #1855 device and app
app: { launchArguments: { AppleLocale: 'fr_FR' } }Verified
Ran it locally: yes
Re-run after the engine contract review, Node 24.19.0, at
7f4a2f21(5a7b87a1after it changes only docs and the changeset;docs:checkandcheck:changeset-bumpsgreen there):pnpm checkgreen.pnpm testgreen (8558 tests across 22 vitest runs, none failed).The reviewer's case against the packed
@e2e-dev/coreande2ein a scratch project:{ AppleLocale: 'fr_FR', AppleLanguages: ['fr'] }initspreadsapp.launchArgumentse2e runpasses,initgets["-AppleLocale","fr_FR","-AppleLanguages","(fr)"]INVALID_CONFIGat config load, exit 2,initnever runs@e2e-dev/mobile@0.12.8e2e listloadsINVALID_CONFIGat config load, exit 2tscaccepts the unchanged[...(info.app.launchArguments ?? [])]against the new declaration.New tests:
engine-protocol.test.ts"hands an engine that predates the object form a list it can spread, and refuses an object at config load" and "carries the object form to an engine that declares launchArgumentValues" (over the loopback protocol). The mobile and desktop engine tests assert the opt-in; removing eitherlaunchArgumentValues: truefails them.On devices, with a hand-run check that lived in the mobile benchmark while this was developed and is no longer in the PR (CI never ran it, and
dumpsysshows only(has extras)on Android): an iPhone simulator (iOS 26.5) and a Pixel 7 emulator, Release builds, the object and the list forms producing the same launch. The simulator process ran ase2eBenchmark -AppleLanguages (fr) -AppleLocale fr_FR; the emulator's launch intent carried the extras. The Android half ran again after0aae6136with--ez.The full gate on the final tree, rebased on main:
pnpm checkgreen, translation check included (thedocs/jaanddocs/zhpages carry the changed code blocks and the new heading, their prose untouched);pnpm testunder Node 24 green across every package (thee2epackage alone: 4870 passed, 11 skipped).Re-run after the last review, Node 24.19.0. The benchmarks and device runs below ran at
209b49faplus the last two commits' changes, before the rebase on main. After the rebase,pnpm checkandpnpm testran again at3822804f, both green (8479 tests across 22 vitest runs):Before the rebase:
pnpm checkgreen.pnpm testgreen (8062 tests across 22 vitest runs).pnpm test:testbed600 passed, 1 skipped.pnpm test:web-benchmark95 passed.CI=1 pnpm --filter @e2e-dev/web-benchmark run test:agent --strict-cache: 26 passed, 8 failed. Same 8 fail on the merge base6fdb1c27: 5 steps have no recording and call the model (no key on this machine), 3 planted-bug judgments the same way.pnpm test:mobile-benchmark, Release builds of the app: iPhone 17 Pro simulator (iOS 26.5) 61 passed, 1 skipped. Pixel 7 emulator (Android 36,google_apis_playstore) 59 passed, 1 failed, 1 skipped. The failure isdevice.e2e.ts"a denied prompt recovers once the permission is granted outside" (alert dismiss did not dismiss the visible alert). No launch arguments in it, and it flakes the same on the merge base with the same APK and emulator (2 of 4 runs fail there, 2 of 3 here).A launch with an object from the config and from
device.openApp({ relaunch: true, launchArguments })on both devices. iOS process (ps):Android
am start(agent-device'sadbcalls, recorded through a wrapper):unit tests:
Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only.!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it..d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and the valid fixture (launchArgumentValuesis a plain boolean, so the invalid fixture needs no change).e2e/engine): changesets fore2e,@e2e-dev/core,@e2e-dev/mobile, and@e2e-dev/desktop.@e2e-dev/webhas no change: it never receives launch arguments.